<template>
  <!-- 趋势 -->
  <div id="poster" ref="imageDom">
  	<div v-show="!report" style="display: flex;justify-content: space-between;">
  		<div>
  			<h2>{{printData.usage}}</h2>
  			<span>{{printData.school}}</span>
  		</div>
  		<div>
  			<div>{{printData.date}}</div>
  			<div v-html="printData.emp"></div>
  			<div>运动项目:{{printData.sport}}</div>
  			<div v-show="printData.scenario">场景:{{printData.scenario}}</div>
  		</div>
  	</div>
  	<hr v-show="!report">
  	<div v-show="!report">
  		<div>运动员:{{printData.playerName}}</div>
  		<div>性别:{{printData.gender}}</div>
  		<div>出生日期:{{$moment(printData.playerBorn).format('YYYY-MM-DD')}}</div>
  	</div>
    <div v-if="chartImg">
      <img :src="chartImg" style="width: 100%;">
    </div>
  	<div style="display: flex;align-items: center;margin: 10px 0;">
  		<div>备注：</div>
  		<div style="width: 20px;height: 20px;background-color: #006633;margin-left:10px;"></div>理想
  		<div style="width: 20px;height: 20px;background-color: #DDDDDD;margin-left:10px;"></div>正常
  		<div style="width: 20px;height: 20px;background-color: #FFCC33;margin-left:10px;"></div>注意
  		<div style="width: 20px;height: 20px;background-color: #FF3300;margin-left:10px;"></div>预警
  		<div style="width: 20px;height: 20px;background-color: #990000;margin-left:10px;"></div>告警
  		<!-- <div style="width: 20px;height: 20px;background-color: #CCCCCC;margin-left:10px;"></div>错误 -->
  	</div>
  	<table class="table" border="1" style="border-collapse: collapse;text-align: center;width: 100%;" bordercolor="#dcdfe6">
      <thead>
        <tr style="height: 35px;">
        	<th>检测时间</th>
        	<th>指标名称</th>
        	<th>检测值</th>
        	<th>单位</th>
        	<th>参考值</th>
        	<th>预警级别</th>
        	<th>检测结果</th>
        	<th>评价</th>
        </tr>
      </thead>
  		<tbody v-for="value,key,index in printData.datas" :key="index">
  			<tr style="height: 35px;" v-for="item,index2 in value" :key="index2">
  				<td style="word-break: break-all;">{{$moment(item.time).format('YYYY-MM-DD')}}</td>
  				<td>{{item.metaName}}</td>
  				<td>{{item.value}}</td>
  				<td>{{item.unit}}</td>
  				<td>{{item.refval}}</td>
  				<td :bgcolor="dict_bgColor[item.warnLevel]" style="color: #5b5b5b;">{{item.warnLevel}}</td>
  				<td>{{item.resultName}}</td>
  				<td>{{item.diagnosis}}</td>
  			</tr>
  		</tbody>
  	</table>
    <div v-show="analysisReport" style="display: flex;">
      <div style="margin-right: 20px;">评价：</div>
      <div v-html="printData.memo||memo"></div>
    </div>
  </div>
</template>

<script>
  export default {
    props: ['printData','usageId','report','memo','analysisReport','chartImg'],
    data() {
    	return {
    		dict_bgColor: {
    			"理想": "#006633",
    			"正常": "#fff",
    			"注意": "#FFCC33",
    			"预警": "#FF3300",
    			"告警": "#990000",
    			"": "#fff",
    			" ": "#fff"
    		}
    	};
    },
  }
</script>

<style scoped>

</style>
